package Thread;

public class test {
    public static void printArray(int[] arr){
        for(int i = 0;i < 100;i++){
            System.out.print(arr[i] + " ");
        }
        System.out.println();
    }
    public static void transform(int[] arr){
        for(int i = 0;i < 100;i++){
            arr[i] = arr[i] * 2;
        }
    }
    public static void sum(int[] arr){
        int ret = 0;
        for(int i = 0;i < 100;i++){
            ret += arr[i];
        }
        System.out.println(ret);
    }

    public static double avg(int[] arr){
        int ret = 0;
        for(int i = 0;i < 100;i++){
            ret += arr[i];
        }
        double k = ret * 1.0 / 100;

        return k;
    }
    public static void main(String[] args) {
        int[] arr = new int[100];

        for(int i = 0;i < 100;i++){
            arr[i] = i + 1;
        }

        System.out.println(avg(arr));

       // sum(arr);
       // transform(arr);
        // printArray(arr);
    }
}
